package cn.pink.gatesrv;
                    
import cn.pink.core.Service;
import cn.pink.core.gen.proxy.RPCImplBase;
import cn.pink.gatesrv.RPCProxy.SessionServiceProxy.EnumCall;
import cn.pink.core.support.function.*;
import cn.pink.core.CallPoint;
import cn.pink.core.Chunk;
import cn.pink.core.gen.IronGenFile;

@SuppressWarnings("unchecked")
@IronGenFile
public final class SessionServiceImpl extends RPCImplBase {
	
	/**
	 * 获取函数指针
	 */
	@Override	
	public Object getMethodFunction(Service service, int methodKey) {
		SessionService serv = (SessionService)service;
		switch (methodKey) {
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_CLOSEIMMEDIATE: {
						return (IronFunctionWithReturn0)serv::closeImmediate;
			}
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_LOGINRESULT_STRING_CALLPOINT_CHUNK: {
						return (IronFunctionWithReturn3<String, CallPoint, Chunk>)serv::loginResult;
			}
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_SENDMSG_INT_CHUNK: {
						return (IronFunctionWithReturn2<Integer, Chunk>)serv::sendMsg;
			}
			default: break;
		}
		
		return null;
	}

	@Override
	public int getMethodLock(Service service, int methodKey) {
		switch (methodKey) {
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_CLOSEIMMEDIATE: {
				return -1;
			}
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_LOGINRESULT_STRING_CALLPOINT_CHUNK: {
				return -1;
			}
			case EnumCall.CN_PINK_GATESRV_SESSIONSERVICE_SENDMSG_INT_CHUNK: {
				return -1;
			}
			default: break;
		}

		return -1;
	}
}
